<HTML><HEAD><TITLE>deprecated(++PredSpec, +Advice)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Predicate Database and Compiler</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>deprecated(++PredSpec, +Advice)</H1>
Declares the specified procedure as deprecated
<DL>
<DT><EM>PredSpec</EM></DT>
<DD>A term of the form Atom/Integer
</DD>
<DT><EM>Advice</EM></DT>
<DD>A string
</DD>
</DL>
<H2>Description</H2>
   This declaration marks a predicate as deprecated. This means that a
   compile-time warning will be raised when a call to this predicate is
   compiled or when the predicate is explicitly imported. The warning
   will include the Advice-string, which is supposed to tell the user
   how to replace the deprecated predicate with a better equivalent.
   <P>
   Deprecation warnings can be suppressed using the pragma
   <PRE>
   :- pragma(deprecated_warnings(off)).
   </PRE>

<H3>Modes and Determinism</H3><UL>
<LI>deprecated(++, +) is det
</UL>
<H3>Modules</H3>
This predicate is sensitive to its module context (tool predicate, see @/2).
<H3>Exceptions</H3>
<DL>
<DT><EM>(4) instantiation fault </EM>
<DD>PredSpec or a component of it is not instantiated.
<DT><EM>(4) instantiation fault </EM>
<DD>Advice is not instantiated.
<DT><EM>(5) type error </EM>
<DD>PredSpec is instantiated, but not to a term of the form Atom/Integer.
<DT><EM>(5) type error </EM>
<DD>Advice is instantiated, but not to a string.
</DL>
<H2>Examples</H2>
<PRE>
    :- deprecated(foo/1, "Please use bar/2 instead").
    foo(99).
</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/compiler/compile-1.html">compile / 1</A>, <A HREF="../../kernel/directives/pragma-1.html">pragma / 1</A>, <A HREF="../../kernel/compiler/get_flag-3.html">get_flag / 3</A>
</BODY></HTML>
